package phapp.service.data.impl;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;
import javacommon.base.*;

import phapp.model.data.*;
import phapp.dao.data.*;
import phapp.service.data.impl.*;
import phapp.service.data.*;
/**
* Title: t_constellation_data  业务处理层
* Description: spring事务实现层,调用Dao层取数据
* Copyright: Copyright (c) 2012-10
* Company:
*
* @author you name
* @version 1.0
*/

@Component("constellationManager")
@Transactional
public class ConstellationManagerImpl extends BaseManager<Constellation,java.lang.Integer>
               implements ConstellationManager {

   /**定义Dao*/
   private ConstellationDao constellationDao;
   /**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性*/
   public void setConstellationDao(ConstellationDao dao) {
      this.constellationDao = dao;
   }

   /**获取Dao*/
   public EntityDao getEntityDao() {
      return this.constellationDao;
   }

   /**
   * <p>分页查询Constellation<br>
   * @param PageRequest pr
   * @return Page
   * @author
   */
   @Transactional(readOnly=true)
   public Page findByPageRequest(PageRequest pr) {
      return constellationDao.findByPageRequest(pr);
   }

   /**
   * <p>批量删除 Constellation<br>
   * @param Constellation u
   * @return Boolean
   * @author
   */
   @Transactional(readOnly=true)
   public Boolean  removeByIdArry(Constellation u) {
      Boolean result =false;
      int i =-1,size=u.getIdList().size();
      i =constellationDao.removeByIdArry(u);
      if(i==size){
         result =true;
      }else{
         throw new RuntimeException();
      }
      return result;
   }


}
